#ifndef     UTILS_H_
# define    UTILS_H_

# include <iostream>
# include <list>
# include "GameObject.h"

# define FLOAT_LIMIT    0.00001

template <class Content>
typename std::list<Content>::iterator insert_sorted(std::list<Content> & list, Content const & item)
{
    typename std::list<Content>::iterator it;

    for (it = list.begin(); it != list.end(); ++it)
        if (*it < item)
        {
            ++it;
            list.insert(it, item);
            return it;
        }
    list.push_back(item);
    return --(list.end());
}

std::ostream & operator<<(std::ostream & os, GameObject::direction const & obj);

#endif   /* UTILS_H_ */
